package io.demo.adaptors;

import io.demo.strategy.Duck;

import static java.lang.System.out;

/**
 * @author create by zhangpengfei at 2021/9/30 09:50
 */

public class TurkeyAdapter extends Duck {
    Turkey turkey;

    public TurkeyAdapter(Turkey turkey) {
        this.turkey = turkey;
    }

    @Override
    public void display() {
        out.println("I'm a turkey adapter");
    }

    @Override
    public void performQuack() {
        turkey.getGobbleBehavior().gobble();
    }

    @Override
    public void performFly() {
        turkey.getFlyBehavior().fly();
    }
}
